package com.xxx.video.login.presenters;

import android.content.Context;
import android.text.TextUtils;

import androidx.annotation.NonNull;

import com.xxx.video.R;
import com.xxx.video.commen.presenters.BasePresenter;
import com.xxx.video.commen.utils.StringUtils;
import com.xxx.video.commen.utils.ToastUtils;


public class InputUserNamePresenter extends BasePresenter<IInputUserNameView> {

    public InputUserNamePresenter(@NonNull Context context, IInputUserNameView baseView) {
        super(context, baseView);
    }

    /**
     * start forget pwd activity
     */
    public void startForgetPwdActivity() {
        String userName = getBaseView() == null ? "" : getBaseView().getUserName();
        if (TextUtils.isEmpty(userName)) {
            ToastUtils.showError(StringUtils.getInstance().getString(R.string.tip_login_username_can_not_empty));
            return;
        }
        if (getBaseView() != null) {
            getBaseView().startForgetPwdActivity();
        }
    }
}
